<form action="shop_pay.manage.php" method="get" name="form_search" id="form_search" onsubmit="return ajax_search_list();">
<input type="hidden" name="action" id="action" value="mode_list" />
<table border="0" cellpadding="0" cellspacing="0" class="from_table2" >
	<tr>
		<th width="15%" align="center" valign="middle"><tpl> $langSysShopPayModeName </tpl> :</th>
		<td width="25%" align="left"><input type="text"  name="search_name" id="search_name" class="txtinput" value="<tpl> $condition.search_name </tpl>" /></td>
		<th width="15%" align="left"><tpl> $langSysShopPayModeType </tpl>:</th>
		<td width="35%" align="left">
			<select name="search_type" id="search_type">
				<option value=""><tpl> $langSysShopPayModeSearchSel </tpl></option>
				<option value="0" <tpl> if $condition.search_type eq '0' </tpl>selected="selected"<tpl> /if </tpl>><tpl> $langSysShopPayModeTypeTime </tpl></option>
				<option value="1" <tpl> if $condition.search_type eq '1' </tpl>selected="selected"<tpl> /if </tpl>><tpl> $langSysShopPayModeTypeNumber </tpl></option>
				<option value="2" <tpl> if $condition.search_type eq '2' </tpl>selected="selected"<tpl> /if </tpl>><tpl> $langSysShopPayModeTypeAll </tpl></option>
			</select>
		</td>
	</tr>
	
</table>
<div class="table-5-bottom"><div class="p-left-3"><span class="btn_left">
		<input name="submit3" value="<tpl> $langSysShopPaySearch </tpl>" type="submit" class="btn_submit"/>
	  </span></div></div>
</form>

<form action="shop_pay.manage.php" id="form_del" name="form_del" method="post">
	<input type="hidden" name="action" id="action" value="mode_del" />
<table  border="0" cellpadding="0" cellspacing="0" class="from_table2_one top-1">
	<thead>
		<tr class="area_ajax_list_title">
		  <th class="pd-left" width="10%" align="center" valign="middle"><tpl> $langSysShopPayDel </tpl></th>
		  <th width="300" align="center" valign="middle"><tpl> $langSysShopPayModeName </tpl></th>
		  <th width="35%" align="center" valign="middle"><tpl> $langSysShopPayModeType </tpl></th>
		  <th width="10%" align="center" valign="middle"><tpl> $langSysShopPayModeMoney </tpl></th>
		  <th width="10%" align="center" valign="middle"><tpl> $langSysShopPayModeOperate </tpl></th>
		</tr>
	</thead>
	<tpl> if $mode_array[0].mode_id neq '' </tpl>
		<tpl> section name=i loop=$mode_array </tpl>
		<tr>
		  <td class="pd-left" width="10%" align="left" valign="middle"><input name="mode_id[]" type="checkbox" value="<tpl> $mode_array[i].mode_id </tpl>"/></td>	
		  <td width="250" align="left" valign="middle"><tpl> $mode_array[i].mode_name </tpl></td>
		  <td width="35%" align="left" valign="middle">
		  <tpl> if $mode_array[i].mode_type eq '0' </tpl>
		  	<tpl> $langSysShopPayModeTypeTime </tpl>
		  <tpl> /if </tpl>
		  <tpl> if $mode_array[i].mode_type eq '1' </tpl>
		  	<tpl> $langSysShopPayModeTypeNumber </tpl>
		  <tpl> /if </tpl>
		  <tpl> if $mode_array[i].mode_type eq '2' </tpl>
		  	<tpl> $langSysShopPayModeTypeAll </tpl>
		  <tpl> /if </tpl>
		  </td>
		  <td width="10%" align="left" valign="middle"><tpl> $mode_array[i].mode_money </tpl></td>
			<td width="10%" align="left" valign="middle"><a href="javascript:;" onclick="hideMessage();ajax_modi('<tpl> $mode_array[i].mode_id </tpl>');" title="<tpl> $langSysShopPayModeEdit </tpl>" class="edit_a_pic" >
		  </a></td>
		</tr>
		<tpl> /section </tpl>
	
	<tpl> else  </tpl>
	<tr>
		<td colspan="6"><tpl> $langSysCNoThing </tpl></td>
	</tr>
	<tpl> /if </tpl>
</table>
<tpl> if $mode_array[0].mode_id neq '' </tpl>
<div class="table-5-bottom">
<div style="float:left; padding-left:20px">
		<span class="btn_left">
			<input name="selectall" type="button" id="selectall" class="btn_submit" value="<tpl> $langSysShopPaySelAll </tpl>" />
		  </span>
			<span class="btn_left">
			<input name="negative" type="button" id="negative" class="btn_submit" value="<tpl> $langSysShopPaySelNav </tpl>" />
			</span>
			<span class="btn_left">
			<input type="button" id="delbutton" class="btn_submit" name="delbutton" value="<tpl> $langSysShopPayDel </tpl>" />
			</span>		</div>
		<div style="float:right; padding-right:20px">
			<tpl> $page_list </tpl>		
		</div>		
</div>
<tpl> /if </tpl>
</form>

<div id="question" style="display:none; cursor: default; padding:10px"> 
	<b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-top:10px; padding-bottom:10px"><tpl> $langCConfirmDelete </tpl></b> <br />
	<input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid #CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
	<input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px;margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
</div> 
<script>
$(document).ready(function() {
	$('#negative').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
		);
	$('#selectall').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	//删除操作
	var options_del = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("shop_pay.manage.php?action=mode_list<tpl>if $mode_array|@count neq 1</tpl>&curpage=<tpl> $curpage </tpl><tpl>/if</tpl>&search_name=<tpl> $condition.search_name </tpl>&search_type=<tpl> $condition.search_type </tpl>");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	var question = $('#question')[0];
	$("#delbutton").click(function(){
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
		$.unblockUI();
		$('#form_del').ajaxSubmit(options_del);	
		return false;
	});
	$('#no').click($.unblockUI);
});
//编辑
function ajax_modi(id){
	//载入页面
	ShowDiv = "result_content";
	getPageContent("shop_pay.manage.php?action=mode_modi&id="+id+"&curpage=<tpl> $curpage </tpl>&search_name=<tpl> $condition.search_name </tpl>&search_type=<tpl> $condition.search_type </tpl>");
}
//搜索
function ajax_search_list(){
	/* 取表单参数 */var queryString=$("#form_search").formSerialize();
	
	$.ajax({
		url: "shop_pay.manage.php",
		data: queryString,
		type:'get',
		dataType:"html",
		beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
		success: function(msg){
			$("#result_content").html(msg);
			hideLoading();
		}
	});
	return false;
}
</script>